﻿<%@ Page Title="" Language="C#" MasterPageFile="~/InputCtrl.Master" AutoEventWireup="true" CodeBehind="ButtonValidator.aspx.cs" Inherits="LiveDemo.InputCtrl.BntValidator.ButtonValidator" %>
<%@ Register
    Assembly="AjaxControlToolkit"
    Namespace="AjaxControlToolkit"
    TagPrefix="AjaxToolkit" %>
<%@ Register assembly="System.Web.Silverlight" namespace="System.Web.UI.SilverlightControls" tagprefix="asp" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <script type="text/javascript">
        function onSourceDownloadProgressChanged(sender, eventArgs) {
            var value = 0;
            if (eventArgs.progress) {
                value = eventArgs.progress;
            }
            else {
                value = eventArgs.get_progress();
            }
            sender.get_element().content.findName("progressBar").Width = value * sender.get_element().content.findName("progressBarBackground").Width;
        }
    </script> 
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <div class="logo_SlInputCtrl"></div>
    <div class="heading">
        ButtonValidator and Hyperlinkbutton Demonstration
    </div>
    <p>
        ButtonValidator and Hyperlinkbutton are an <b>Silverlight controls</b> to automatically run the 
        validators before you run the Click event. Only if the validation is successful 
        the click event is fired.
    </p>
    <div style="height:455px;width:540px">
        <asp:Silverlight ID="Silverlight1" 
                runat="server" 
                Source="~/ClientBin/ButtonValidatorDemo.xap" MinimumVersion="2.0.31005.0" 
                Windowless="true"
                OnPluginSourceDownloadProgressChanged ="onSourceDownloadProgressChanged"
                SplashScreenSource="SplashButtonValidator.xaml"
                Height="100%" 
                Width="100%">
        </asp:Silverlight>
    </div>
    <asp:Panel ID="properties_HeaderPanel" runat="server" Style="cursor: pointer;">
        <div class="heading">
            <asp:ImageButton ID="Properties_ToggleImage" runat="server" ImageUrl="~/images/expand.jpg" AlternateText="expand"  />
            Dependency Properties
        </div>
    </asp:Panel>
    <asp:Panel ID="properties_ContentPanel" runat="server" Style="overflow: hidden;" Height="0px">
        <p>
            <span class="subheading">
            GroupValidator:
            </span>
            The name of the validation group to which this validation control belongs.Default value is empty.
        </p>
        <p>
            <span class="subheading">
            ValidateAllGroups:
            </span>
            If true, validation all groups.
        </p>
    </asp:Panel>

    <ajaxToolkit:CollapsiblePanelExtender ID="cpeProperties" runat="Server"
        TargetControlID="properties_ContentPanel"
        ExpandControlID="properties_HeaderPanel"
        CollapseControlID="properties_HeaderPanel"
        SuppressPostBack ="true"
        CollapsedImage ="~/Images/expand.jpg"
        ExpandedImage ="~/Images/collapse.jpg"
        Collapsed="True"
        ImageControlID="properties_ToggleImage" />

</asp:Content>
